<%@ page import="ghr.day0109.lottery.dao.UserDao" %>
<%@ page import="java.util.Map" %>
<%@taglib prefix="format" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="ghr.day0109.lottery.dao.impl.UserDaoimpl" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="ghr.day0109.lottery.entity.UserMark" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Gong
  Date: 2023/1/10
  Time: 11:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--指定jstl标签库引用--%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
<%--    <%--%>
<%--        UserDao userDao = new UserDaoimpl();--%>
<%--        //创建map集合对象，用来存储查询列表的搜索条件参数--%>
<%--        Map<String, Object> map = new HashMap<>();--%>
<%--        List<UserMark> userMarks = userDao.queryChooseMode(map);--%>

<%--        //简化--%>
<%--        request.setAttribute("user",userMarks);--%>
<%--        //request请求跳转--%>
<%--        //response--%>
<%--        response.sendRedirect("");--%>
<%--    %>--%>
</head>
<body>
<div>
    <c:out value="js" escapeXml="false"/>
    <table id="table" class="last">
        <tr>
            <th>姓名</th>
            <th>中签编码</th>
            <th>持照状态</th>
            <th>手机号码</th>
            <th>开户日期</th>
            <th>操作</th>
        </tr>
<%--        迭代标签items="${user} var = “变量”
<c:if test="${u.status eq 0}">未持照</c:if> if单分支

                        <c:when test="${u.status eq 0}">未持照</c:when>
                        <c:otherwise>已持照</c:otherwise>
                        java中的if else

                        varStatus迭代标签状态属性
--%>
        <c:forEach items="${user}" var="u" varStatus="vs">
<%--            使用foreach 和varStatus 实现隔行换色--%>
            <tr <c:if test="${vs.index%2==0}">style="background-color: lightblue" </c:if>
                <c:if test="${vs.index%2!=0}">style="background-color: lightyellow" </c:if>
            >
<%--                <td>${vs.count}|${vs.index}</td>--%>
                <td>${u.userName}</td>
                <td>${u.markNo}</td>
<%--                <td>${u.status}</td>--%>
                <td <c:if test="${u.status eq 1}">style="color: #B500FF" </c:if>>
<%--                    <c:if test="${u.status eq 0}">未持照</c:if>--%>
<%--                    <c:if test="${u.status eq 1}">已持照</c:if>--%>
                    <c:choose>
                        <c:when test="${u.status eq 0}">未持照</c:when>
                        <c:otherwise>已持照</c:otherwise>
                    </c:choose>
                </td>
                <td>${u.phone}</td>
                <td> ${u.openDate} </td>
                <td>
                    <a href="">详情</a>
                    <a href="">删除</a>
                </td>
            </tr>


        </c:forEach>
    </table>
        </div>
</body>
</html>
